local cuiping = fk.CreateSkill({
  name = "jy__cuiping",
  tags = {Skill.Compulsory,},
})


cuiping:addEffect(fk.CardUseFinished, {
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(cuiping.name) and data.card.color==Card.Red
    and player:getMark("@@jy__cuiping_red-turn")==0
  end,
  on_cost = Util.TrueFunc,
  on_use = function (self, event, target, player, data)
    if data.card.color==Card.Black then
       player.room:addPlayerMark(player, "@@jy__cuiping_black-turn")
    end
    if data.card.color==Card.Red then
      player.room:addPlayerMark(player, "@@jy__cuiping_red-turn")
    end
  end,
})

cuiping:addEffect(fk.CardUseFinished, {
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(cuiping.name) and data.card.color==Card.Black
    and player:getMark("@@jy__cuiping_black-turn")==0
  end,
  on_cost = Util.TrueFunc,
  on_use = function (self, event, target, player, data)
    if data.card.color==Card.Black then
       player.room:addPlayerMark(player, "@@jy__cuiping_black-turn")
    end
    if data.card.color==Card.Red then
      player.room:addPlayerMark(player, "@@jy__cuiping_red-turn")
    end
  end,
})


cuiping:addEffect("prohibit", {
  mute = true,
  is_prohibited = function (self, from, to, card)
    if to:hasSkill(cuiping.name)then
      return to:getMark("@@jy__cuiping_black-turn")==0 and from.phase == Player.NotActive and from.id~=Player.id
    end
  end,
})

cuiping:addEffect(fk.CardUsing, {
  mute = true,
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(cuiping.name) and player ~= target and player:getMark("@@jy__cuiping_red-turn")==0
    and target.phase == player.phase
  end,
  on_use = function(self, event, target, player, data)
    data.disresponsiveList = player.room:getAlivePlayers(false)
  end,
})

cuiping.jy__zhongliu_type = Player.HistoryPhase

Fk:loadTranslationTable{
  ["jy__cuiping"] = "翠屏",
  [":jy__cuiping"] = "<b>锁定技</b>，你的回合内，若你本回合未使用过黑色/红色牌，你不能成为其他角色使用牌的目标/其他角色使用牌时不能被响应。",
  ["$jy__cuiping1"] = "幕前舞蹁跹，只见惊鸿，谁解一腔丹心。",
  ["$jy__cuiping2"] = "幽僻独嗟叹，君心踟蹰，妾愿分国忧。",
  ["@@jy__cuiping_black-turn"] = "使用过黑色牌",
  ["@@jy__cuiping_red-turn"] = "使用过红色牌",
}

return cuiping

